﻿using OpenCvSharp;
using Xc.DataAccess.CodeReader.Properties;
using Xc.DataAccess.Core;

namespace Xc.DataAccess.CodeReader.Models.Filters
{
    [Filter("垂直连接器",FilterType.Algorithm)]
    public class AlgorithmVCntract : FilterBase
    {
        /// <summary>
        /// 输入图像
        /// </summary>
        [InputParameter("输入图像")]
        public Mat ConcatMats { get; set; }

        internal override ResultData<Mat> UseChannel(Mat mat, FilterBase[] filterInfos, FilterBase preFilterBase)
        {
            var ConcatResult = new Mat();
            if (ConcatMats == null)
            {
                return ResultData<Mat>.Reject(TextResource.concat_failed, ConcatResult);

            }
            Cv2.VConcat(mat, ConcatMats, ConcatResult);
            return ResultData<Mat>.Accept(TextResource.concat_success, ConcatResult);
        }
    }
}
